<?php
//error_reporting(E_ALL);
//ini_set("display_errors", 1);

$dbname = 'aiaffiliate11';
$username = 'aiaffiliate11';
$password = 'CdqAia11!';
$hostname = "aiaffiliate11.db.6934650.hostedresource.com:3306";
//$hostname = "50.63.244.174:3306";

// Overide database settings if global vars are defined
if (defined('aidbhost') && defined('aidbname') && defined('aidbuser') && defined('aidbpass')) {
    $dbname = aidbname;
    $username = aidbuser;
    $password = aidbpass;
    $hostname = aidbhost;
}

$canDirectConnectToDB = true;

//Connecting to your database
$aicon = @mysql_connect($hostname, $username, $password);
if (!$aicon) {
    //die("Could not connect: " . mysql_error());
    $canDirectConnectToDB = false;
} else {
    $db = mysql_select_db($dbname, $aicon);
    if (!$db) {
        //die("Could not select database: " . mysql_error());
        $canDirectConnectToDB = false;
    }
}
?>